Repository navigation
fix(scripts): each core download uses its own temp directory - #33
Merged
Merged
Conversation
The download scripts wrote the archive to one shared file in the system temp directory, so two packages that installed at the same time removed each other's archive. Each run now writes into its own directory from mkdtemp and removes it when the unpack is done or fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the changes isolating native core downloads in per-run temporary directories.
No open issues 🎉
What changed in this PR
This PR prevents concurrent package installations from interfering with each other’s native core downloads by giving each script run its own temporary directory.
Changes:
- Create unique temporary directories with
mkdtempSyncfor both core archives. - Remove temporary directories in
finally, including when writing or extraction fails. - Simplify archive filenames while preserving checksum validation and extraction destinations.
| File | Description |
|---|---|
| scripts/download-core-ios.mjs | Isolates the iOS core archive per run and ensures temporary-directory cleanup. |
| scripts/download-core-android.mjs | Isolates the Android core archive per run and ensures temporary-directory cleanup. |
Review effort: Balanced
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The core download scripts wrote the archive to one shared file,
$TMPDIR/<core>-<checksum>.zip, so two packages installing at the same time removed each other's archive (ENOENTonrmSync). Each run now writes into its own directory frommkdtempSyncunderos.tmpdir(), unpacks from there, and removes the directory in afinally. The checksum is gone from the archive's file name, since the directory is already unique. The rest of the script stays as it was.Checks
node scripts/download-core-android.mjsandnode scripts/download-core-ios.mjs, run at the same time as the other bridges' download scripts on a fresh checkout: all exit 0, the core unpacked, no new entries left in$TMPDIRnpm run lint: exit 0 (ESLint, Prettier, SwiftLint)🤖 Generated with Claude Code